// gfreebox - A Freebox remote control
//
// Copyright (C) 2011 Laurent BRULET
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 of the License, or (at your option)
// any later version.
// 
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#ifndef REMOTEWINDOW_H
#define REMOTEWINDOW_H

#include <vector>
#include <gtkmm.h>

class FreeboxInt;
class ConfigurationManager;

class RemoteWindow: public Gtk::Window
{
    public:
        struct Key
        {
            std::string key;
            bool longPress;
            int repeat;
        };

    public:
        RemoteWindow();
        virtual ~RemoteWindow();
        void SetFreeboxInt(FreeboxInt *p_freeboxInt);
        void SetConfigurationManager(ConfigurationManager *p_cm);

        virtual void OnButtonClicked(RemoteWindow::Key k);
        virtual void OnNewCode();

    private:
        void connectButton(Gtk::Button *p_button, std::string key, bool longPress=false);
        Gtk::Button *createButton(int left, int top, const char *text, const char*key, bool longPress=false);
        std::vector<Gtk::Button *> m_buttonList;

        FreeboxInt *m_p_freeboxInt;
        ConfigurationManager *m_p_cm;
        Gtk::Table m_container;
        Gtk::Entry *m_p_entryCode;
};

#endif // REMOTEWINDOW_H
